import request from "@/utils/http";
import type { Result, MessageVo } from "@/types";

const message = {
  textChat(type: string, chatId: number, content: string) {
    return request.post(
      "/block/textChat",
      {
        type: type,
        chatId: chatId,
        content: content,
      },
      {},
      false
    ) as Promise<Result<MessageVo>>;
  },
  imageChat(type: string, chatId: number, content: string) {
    return request.post(
      "/block/imageChat",
      {
        type: type,
        chatId: chatId,
        content: content,
      },
      {},
      false
    ) as Promise<Result<MessageVo>>;
  },
};

export default message;
